<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>Facelet Title</title>
        <script type="text/javascript" src="/resources/js/jquery-1.8.0.min.js"/>
        <script language="javascript">
            $(document).ready(function(){
                $("#frm\\:btn1").click(function(){
                    $("#frm\\:btn3").addClass('ui-state-disabled');
                });
                $("#frm\\:btn2").click(function(){
                    $("#frm\\:btn3").removeClass('ui-state-disabled');
                });
            });
        </script>
    </h:head>
    <h:body>
        <h:form id="frm">
            <p:commandButton id="btn1" value="Executa 1"/>
            <p:commandButton id="btn2" value="Executa 2"/>
            <p:commandButton id="btn3" value="Teste"/>
        </h:form>
    </h:body>
</html>

